package com.zzb.demo.mapper;

import com.zzb.demo.model.domain.Worker;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * @Author zzb
 * @Date 2024/10/22 10:25
 * @Version 1.0
 * @description
 */
public interface WorkerMapper {

    @Select(value = "select * from tb_worker where id = #{id}")
    Worker selectWorkerById(Integer id);

    @Insert(value = "insert into tb_worker(id,name,sex) values (#{id},#{name},#{sex})")
    Integer InsertWorker(Worker worker);

    @Insert(value = "update tb_worker set name = #{name},sex = #{sex} where id = #{id}")
    Integer updateWorker(Worker worker);

    @Delete(value = "delete from tb_worker where id = #{id}")
    Integer deleteWorkerById(Integer id);
}
